package gui;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Color;
import java.awt.GridBagLayout;
import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Rectangle;
import java.awt.Font;
import java.sql.SQLException;

import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JTextArea;
import javax.swing.JList;
import javax.swing.JTextPane;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;

import secretaryGUI.createSecretaryWindow;

import com.sun.rowset.CachedRowSetImpl;

import flexibility.CachedRowSetTableModel;
import guiCode.assignmentscode;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class assignmentsGUI extends JPanel{
	assignmentscode asc;
	TeacherMainMenuGUI tmmc;
	private JTable table;
	public JTable table_1;
	public JScrollPane scrollPane_1;
	public JButton button;
    JLabel lblThrerIsNo;
	
	public assignmentsGUI() {
		super();
		initialize();
	}
	private void initialize() {
		this.setSize(900,600);
		this.setBackground(UIManager.getColor("InternalFrame.activeTitleBackground"));
		SpringLayout springLayout = new SpringLayout();
		setLayout(springLayout);
		
		JPanel panel = new JPanel();
		panel.setBackground(UIManager.getColor("InternalFrame.activeTitleBackground"));
		springLayout.putConstraint(SpringLayout.NORTH, panel, 75, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.WEST, panel, 22, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.SOUTH, panel, -105, SpringLayout.SOUTH, this);
		springLayout.putConstraint(SpringLayout.EAST, panel, 868, SpringLayout.WEST, this);
		add(panel);
		SpringLayout sl_panel = new SpringLayout();
		panel.setLayout(sl_panel);
		
		JLabel lblListOfAssignments = new JLabel("List of assignments for the selected course and semester:");
		sl_panel.putConstraint(SpringLayout.WEST, lblListOfAssignments, 111, SpringLayout.WEST, panel);
		lblListOfAssignments.setFont(new Font("Tahoma", Font.BOLD, 15));
		sl_panel.putConstraint(SpringLayout.NORTH, lblListOfAssignments, 29, SpringLayout.NORTH, panel);
		panel.add(lblListOfAssignments);
		
		table_1 = new JTable();	
		table_1.setModel(new DefaultTableModel(
			new Object[][] {
				{null, null},
				{null, null},
			},
			new String[] {
				"New column", "New column"
			}
		));
		
		scrollPane_1 = new JScrollPane(table_1);
		sl_panel.putConstraint(SpringLayout.NORTH, scrollPane_1, 55, SpringLayout.SOUTH, lblListOfAssignments);
		sl_panel.putConstraint(SpringLayout.EAST, scrollPane_1, 39, SpringLayout.EAST, lblListOfAssignments);
		sl_panel.putConstraint(SpringLayout.WEST, scrollPane_1, 111, SpringLayout.WEST, panel);
		panel.add(scrollPane_1);
		
		button = new JButton("Back to the list of courses per semester");
		button.setFont(new Font("Tahoma", Font.BOLD, 14));
		sl_panel.putConstraint(SpringLayout.WEST, button, 26, SpringLayout.WEST, panel);
		sl_panel.putConstraint(SpringLayout.SOUTH, button, -10, SpringLayout.SOUTH, panel);
		panel.add(button);
		
		lblThrerIsNo = new JLabel("threr is no feedback for this assignment");
		sl_panel.putConstraint(SpringLayout.SOUTH, scrollPane_1, -17, SpringLayout.NORTH, lblThrerIsNo);
		sl_panel.putConstraint(SpringLayout.EAST, lblThrerIsNo, -432, SpringLayout.EAST, panel);
		lblThrerIsNo.setIcon(new ImageIcon(assignmentsGUI.class.getResource("/com/sun/java/swing/plaf/windows/icons/Warn.gif")));
		lblThrerIsNo.setFont(new Font("Tahoma", Font.PLAIN, 14));
		sl_panel.putConstraint(SpringLayout.NORTH, lblThrerIsNo, 273, SpringLayout.NORTH, panel);
		sl_panel.putConstraint(SpringLayout.WEST, lblThrerIsNo, 111, SpringLayout.WEST, panel);
		lblThrerIsNo.setForeground(Color.RED);
		panel.add(lblThrerIsNo);
		lblThrerIsNo.setVisible(false);
		
		
	}
}
